// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ApplicationContext.cs" company="">
//   
// </copyright>
// <summary>
//   application context.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Witcraft.Halcyone.Core.Silverlight
{
    using System;
    using System.Security.Principal;

    using Authentication.Silverlight;

    /// <summary>
    /// application context.
    /// </summary>
    public class ApplicationContext : IApplicationContext
    {
        private readonly IAuthenticationManager authenticationManager;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="authenticationManager"></param>
        public ApplicationContext(IAuthenticationManager authenticationManager)
        {
            this.authenticationManager = authenticationManager;
        }

        /// <summary>
        /// Gets Error.
        /// </summary>
        public Exception Error { get; set; }

        /// <summary>
        /// Gets User.
        /// </summary>
        public IPrincipal User 
        { 
            get
            {
                return this.authenticationManager.User;
            }
        }
    }
}